// import { Select } from "antd"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useOptions } from "@/hooks/useOptions"
import { useLocale } from "@/locales"

export type RiskBusinessModelSelectorField = {
	businessModel: string
}

export const RiskBusinessModelSelector: FC<any> = props => {
	const { rules, disable, labelProps, selectorProps, notBoth, placeholder } = props
	const { formatMessage } = useLocale()
	const options = useOptions({ modal: "businessModel", func: formatMessage, strictlyLabel: false })
	if (notBoth) options.shift()
	return (
		<SFormItem
			name="businessModel"
			label={`${formatMessage({ id: "label.member.business_model" })}:`}
			rules={rules}
			{...labelProps}
		>
			<StyleSelect
				placeholder={formatMessage({ id: placeholder })}
				allowClear
				options={options}
				disable={disable}
				{...selectorProps}
			/>
		</SFormItem>
	)
}
